/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package strings;

//import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
import java.util.*;
import java.io.*;
import java.lang.*;

/**
 *
 * @author ww
 */
public class StringS {
    
static void count(String x,b){
    
    int array[];
    int k=0;
     
    for (int i = 1; i < b; i++){
            
         char c = s.charAt(i);         
         array [i] = c;};
         
    for (int i = b; i >0 ; i--){
            for (int j = 0; j < i; j++) {                  
                    if ((array[j]= array[i]) && (array[j]!=0)) {
                        array[j]=0;
                    }
                    array[i]=0;
                    k+=1;                        
            }
    }                          
 }
 
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        
     BufferedReader bReader = new BufferedReader (new InputStreamReader(System.in));         
        String s;
    s = bReader.readLine();
     
     int n = s.length();
     
     
     for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i); 
             if ( c =='.' || c ==',' || c =='!' || c =='?' || c =='…' || c ==':' || c ==';' || c =='-' || c =='"' )
                 s = s.substring(0, i) + s.substring(i+1);
                 }
    Scanner sc = new Scanner(s);
    while ( sc.hasNext() ){
            int m=sc.next().length();
            count(sc.next().toLowerCase(),m);
            if (k=2) s = s.delete(s.indexOf(sc.next()),m).toString();
    }
    System.out.println(s);
    }
}

